<div class="bjui-pageHeader">
  <form id="pagerForm" data-toggle="ajaxsearch" action="{:U('user')}" method="post">
      <input type="hidden" name="groupId" value="{:I('groupId')}" />
    <div class="bjui-searchBar">
        <div class="bjui-searchBar">
            <label>姓名：</label>
            <div role="group" class="btn-group">
                <input type="text" name="nickname">
            </div>
            &nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <!--<a class="btn btn-orange" href="javascript:;" onclick="$(this).navtab('reloadForm', true)" data-icon="undo">清空查询</a>&nbsp;-->
        </div>
    </div>
  </form>
</div>
<div class="bjui-pageContent tableContent">
  <table data-toggle="tablefixed">
    <thead>
      <tr>
        <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck"></th>
        <th>姓名</th>
        <th>用户分组</th>
        <th>手机</th>
		<th>邮箱</th>
        <th>最后登录时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <notempty name="_list">
      
      <volist name="_list" id="vo">
          <?php $group_ids=explode(',', $vo['group_ids']);?>
          <tr data-id="{$vo.uid}">
          <td><input type="checkbox" name="ids" data-toggle="icheck" value="{$vo.uid}"></td>
          <td>{$vo.nickname}</td>
          <td>
              <?php if($group_ids && count($group_ids)>1):?>
              <select>
                  <option>--非当前分组--</option>
                  <volist name="group_ids" id="v">
                      <option <?php echo I('groupId')==$v ? 'selected' : '';?>>{:getColumnNameForModel($v, 'AuthGroup', 'title')}</option>
                  </volist>
              </select>
              <?php elseif($group_ids && count($group_ids)==1):?>
              {:getColumnNameForModel(current($group_ids), 'AuthGroup', 'title')}
              <?php endif;?>
          </td>
          <td>{$vo.mobile}</td>
		  <td>{$vo.email}</td>
          <td>{$vo.last_login_time|time_format}</td>
            <td>
                <?php if($group_ids && in_array(I('groupId'), $group_ids)):?>
                    <a href="{:U('removeFromGroup?uId='.$vo['uid'].'&groupId='.I('groupId'))}" class="btn btn-red" data-toggle="doajax" data-type="GET">解除</a>
                <?php else:?>
                    <a href="{:U('addToGroup?uId='.$vo['uid'].'&groupId='.I('groupId'))}" class="btn btn-green" data-toggle="doajax" data-type="GET">授权</a>
                <?php endif;?>
            </td>
        </tr>
      </volist>
      <else/>
    <td colspan="9" class="text-center"> aOh! 暂时还没有用户! </td>
      </notempty>
      </tbody>
  </table>
</div>
<div class="bjui-pageFooter">
    <div class="pages"><span>每页&nbsp;</span>

        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="{$pageSize}">{$pageSize}</option>
                <option value="{$pageSize*3}">{$pageSize*3}</option>
                <option value="{$pageSize*6}">{$pageSize*6}</option>
                <option value="{$pageSize*12}">{$pageSize*12}</option>
                <option value="{$pageSize*15}">{$pageSize*15}</option>
            </select>
        </div>
        <span>&nbsp;条，共 {$total} 条</span></div>
    <div class="pagination-box" data-toggle="pagination" data-total="{$total}" data-page-size="{$pageSize}"
         data-page-current="{$pageCurrent}"></div>
</div>
</div>
